package factory;

import dao.PetDao;
import dao.PetDaoMysqlimpl;
import dao.PetDaoOracleimpl;

public class PetDaoFactory {
    public static String defaultBeanName="petDaoMySQLimpl";

    public static PetDao getInstance(String beanName){
        PetDao petDao=null;
        switch (beanName){
            case "petDaoMySQLimpl":
                petDao=new PetDaoMysqlimpl();
                break;
            case "petDaoOracleimpl":
                petDao=new PetDaoOracleimpl();
                break;
            default:
                throw new RuntimeException("未找到：'"+beanName+"'对应的对象");
        }
        return petDao;
    }
}
